<?php $this->load->view(TEMPLATE_NAME.'/admin/header');?>

<?php $this->load->view(TEMPLATE_NAME.'/admin/side_left');?>

<script type="text/javascript" src="<?php echo base_url()?>js/jquery-1.4.2.js"></script>

<style type="text/css" title="text/css"> 

/* == Pagination === */

ul{border:0; margin:0; padding:0;}



#pagination-digg {

    text-align:center;

    list-style:none;

    margin-bottom:20px;

}

#pagination-digg li{

    border:0; margin:0; padding:0;

    font-size:11px;

    margin-right:2px;

    display:-moz-inline-stack;

    display:inline-block;

    zoom:1;

    display:inline;

} 

#pagination-digg li.active {

    padding:2px 5px;

    border:1px solid #999999;  

}

#pagination-digg li a {

    border:1px solid #999999;

    color:#666666;

    font-size:11px;

    padding:2px 5px;

}

#pagination-digg li.next a, #pagination-digg li.prev a{

    border:0 none;

    color:#990066;

    float:left;

    font-size:15px;

    font-weight:bold;

    margin-top:-4px;

}

#pagination-digg li.next {

    float:right;

}

#pagination-digg li.prev {

    float:left;

}

#pagination-digg li a:hover, #pagination-digg li.active, #pagination-digg li.next a:hover, #pagination-digg li.prev a:hover {

    background-color:#990066;

    color:#FFFFFF;

    text-decoration:none;

}

</style>

<script type="text/javascript">       

$(document).ready(function(){

    $('#order_by').change(function(){

        $('#order_form').submit();

    });    

    $('#order_by').val('<?php echo $order?>');    

});

</script>

<div class="page noright adminpage">

<h5 class="purple">The Mykprisguide profile Directory</h5>

<hr />

<?php $this->load->view(TEMPLATE_NAME.'/admin/directory/directory_admin_header');?>

<hr /> 

<h3 class="purple">directory user</h3>

<hr />

<?php 

$form_attribute = array('id'=>'order_form');

if($status == 'active'){

    $action = 'admin/design_directory/index';

}else{

    $action = 'admin/design_directory/index/status/inactive';

}

echo form_open($action,$form_attribute);?>

<select id="order_by" name="order_by">

<option value="date_desc">View new to old</option>

<option value="date_asc">View old to new</option>

<option value="company_asc">Alphabetical by Company name</option>

<option value="email_asc">Alphabetical by e-mail</option>

<?php

for ($i=65; $i<= 90; $i++) {

$x = chr($i);

?>

<option value="<?php echo $x; ?>"><?php echo $x ?> company names</option>

<?php

}

?>

</select>

<?php echo form_close();?>

<hr />

<p class="purple f13"><?php echo $count;?> listings to display based on the viewing options selected above</p>

<hr />  



<?php echo form_open($action);?>

<table class="tableadmin" style="margin:0" cellpadding="0">

<?php if(!empty($list_company)){ 

    foreach($list_company as $company){

        // date formatting

        $alert_unix = strtotime($company['last_edited']);

        $alert_time = date('H:i',$alert_unix);

        $alert_date = date('d M Y',$alert_unix);        

?>

<tr>


<td width="50%"><?php echo $company['company']!=''?$company['company']:'Details not entered yet.'?></td>

<td width="20%"><?php echo $company['city_name']?></td>

<td><?php echo form_checkbox('company[]', $company['id'], FALSE);?></td>

<td class="purple"><?php echo $alert_date ?> at <?php echo $alert_time ?></td>

<td><a href="<?php echo site_url('admin/design_directory/login_detail')?>/id/<?php echo $company['id'];?>">edit</a></td></tr>

<?php }// end foreach 

}else{ // end if ?>

<tr><td colspan="5">No data</td></tr>

<?php } ?>

</table>

<?php if(!empty($list_company)){

$form_button = array(

    'type'=>'submit',

    'name'=>'submit',

    'value'=>'submit',

    'class'=>'delete',

    'content'=>'Delete Selected',

);

echo form_button($form_button);

} 

echo form_close();?>

<hr />

<!--<div class="prevnext"> -->

<ul id="pagination-digg"> 

    <?php echo $pagination ?>

</ul>

<!--</div>--> 

</div><!-- page -->

<?php $this->load->view(TEMPLATE_NAME.'/admin/footer');?>